<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<!DOCTYPE html>
<html lang="zh-tw">
<head>
<meta charset="UTF-8">
<title>練習清單</title>
<!-- favicon -->
<link rel="shortcut icon" type="image/x-icon" href="images/favicon.ico">
<link rel="Bookmark" href="images/favicon.ico" type="image/x-icon"/>
<!-- reset.css -->
<link rel="stylesheet" href="css/reset.css" media="screen">
<!-- Skeleton grid system -->
<link rel="stylesheet" href="css/skeleton.css" media="screen">
<!-- css -->
<link rel="stylesheet" href="css/style.css" media="screen">
<!-- rwdmenu -->
<link type="text/css" rel="stylesheet" href="css/jquery.mmenu.css" />
<!-- Layout and Media queries-->
<link rel="stylesheet" href="css/layout.css" media="screen">


<!-- font-awesome.css -->
<link rel="stylesheet" href="css/font-awesome.min.css" media="screen">

<!--[if lt IE 9]>
        <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
    <![endif]-->

<!-- Mobile Specific Meta -->
<meta name="viewport"
	content="width=device-width,initial-scale=1.0,maximum-scale=1.0,minimum-scale=1.0,user-scalable=0">
</head>
<body>
	<div id="page">
		<div class="header FixedTop">
			<a href="#menu" class="headericon"></a>
			<img src="images/logo.png" alt="proactive Logo">
		</div><!-- header -->
		<div class="content">
			<div class="list-screen clearfix">
				<div class="navfull">
					<div class="container">
						<div class="grid_12">
							<div class="logo"><a href="index">Proactive</a></div>
							<ul class="topnav">
							<c:forEach items="${menuList}" var="menu">
								<li>
									<a href="${menu.url}" class="${menu.classString1}">
										${menu.icon}
										${menu.name}
									</a>
								</li>
							</c:forEach>	
							</ul>
							<ul class="login">
								<li><a href="register">註冊</a></li>
								<li><a href="login">登入</a></li>
							</ul>
						</div>
					</div>
				</div>
			</div>
			<div class="worksListPrac fullbackground">
				<div class="container">
					<div class="grid_12"><br/>
						<a href="showCourse?id=${course.id}">
							<h3>[課程] ${course.title}</h3>
						</a>
						<a href="#" class="addTopButton" data-reveal-id="login">我也要上傳練習</a>
					</div>
				</div>	
			</div>
			<div class="courseList">
				<ul class="container">
					<c:forEach items="${designList}" var="design">
						<li class="grid_3">
							<div class="courseBox">
								<a href="showDesign?id=${design.id}" class="courseBoxImg">
									<img src="https://s3-ap-northeast-1.amazonaws.com/proactive/${design.imagePath}">
								</a> 
								<a href="showDesign?id=${design.id}" title="${design.title}" class="courseBoxTitle ${design.practiceClass}">
									<c:if test="${design.isPractice == 1}">
										<img src="images/practice.png">
									</c:if>
									${design.title}
								</a>
								<ul class="tools clearfix">
									<li>
										<img src="images/view.png" class="view">
										<span>${design.viewCount}</span>
									</li>
									<li>
										<img src="images/cmnt.png" class="cmnt"> 
										<span>${design.commentCount}</span>
									</li>
									<li>
										<img src="images/like.png" class="like"> 
										<span>${design.favoriteCount}</span>
									</li>										
									<c:if test="${design.downloadUrl != '' || design.fileUrl != ''}">
									<li class="attach">
										<a href="${design.isFile==1?design.downloadUrl:design.fileUrl}" target="_blank" class="pic_a"> 
											<img src="images/attach.png" class="attach">
											<img src="images/attach2.png" class="attach2">
										</a>
									</li>	
									</c:if>
								</ul>
							</div>
						</li>
					</c:forEach>
					<li class="clear"></li>
				</ul>
			</div><!-- courseList -->
			<div class="page clearfix">
				<ul>
					<c:forEach items="${page.pagerList}" var="pager">
						<li class="${pager.indexClass}"><a href="${pager.url}">${pager.index}</a></li>
					</c:forEach>	
	            </ul>
	        </div><!-- page -->
			<div><a href="#" id="gotop">回頂端</a></div>
		</div><!-- content -->
		<!-- 左側meum滑出 -->
		<nav id="menu">
			<ul>		 
				<li class="logo"><a href="index">美編網</a></li>
				<c:forEach items="${menuList}" var="menu">				
				<li class="${menu.classString2}">
					<a class="${menu.classString1}" href="${menu.url}">${menu.icon}${menu.name}</a>
				</li>
				</c:forEach>		
				<li class="menumember"><a href="register">註冊</a></li>
				<li class="menumember"><a href="login">登入</a></li>
			</ul>
		</nav>
	</div><!-- page -->
	
	
	<div id="login" class="reveal-modal">
		<header class="reveal-modal-header">
			<p style="text-align: center;">
				<strong style="font-size: 28px;">登入</strong>
				<img class="pop_logo" alt="pop_logo" src="images/pop_logo.png">
			</p>
		</header>
		<div class="cont clearfix">
			<form style="text-align: center;" id="loginForm" method="post" action="checkLogin"> 
				<label><input type="text" placeholder="請輸入帳號" class="textbox account" name="account"></label><br>
				<label><input type="password" placeholder="請輸入密碼" class="textbox key" name="password"></label><br>
				<a href="forgetPassword" style="padding-left: 70px;margin-top: 10px;display: inline-block;">忘記密碼</a>
				<a href="register">成為會員</a><br>
				<button class="btn_login">登入</button>
			</form>
		</div>
	</div>
	
				
	<!-- import jquery -->
	<script
		src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>


	<!-- some jquery method we use -->
	<script src="js/hoverjquery.js"></script>
	<script src="js/listscreen.js"></script>	
	<script src="js/ourjquery.js"></script>	
	
	
	<!-- validate -->
    <script src="js/jquery.validate.js"></script>
    <script src="js/messages_zh_TW.js"></script>
    <script src="js/additional-methods.js"></script>   
	<!-- Reveal Modal -->
	<script type="text/javascript" src="js/jquery.reveal.js"></script>	
	<!-- rwdmenu -->
	<script type="text/javascript" src="js/jquery.mmenu.min.all.js"></script>
	
	<script type="text/javascript">
		$(function() {
			$('nav#menu').mmenu();
			
			$("#loginForm").validate({
				rules:{
					account:"required",
					password:"required"
				}
			});
		});
	</script>
	
</body>
</html>